<?php 
//echo 'comments = '.$_POST['comments'].',name = '.$_POST['contactName'].', subject = '.$_POST['subject'].',email = '.$_POST['email'].'<br>';
if(isset($_POST['submitted']))
{
	//Check to make sure that the name field is not empty
	if(trim($_POST['contactName']) === '' || trim($_POST['subject']) === '' || trim($_POST['comments']) === '' || trim($_POST['email']) === '')
	{
		$hasError = true;
	} else {
		$name = trim($_POST['contactName']);
		$subject = trim($_POST['subject']);
		$email = trim($_POST['email']);
		if(function_exists('stripslashes')) {
			$comments = stripslashes(trim($_POST['comments']));
		} else {
			$comments = trim($_POST['comments']);
		}
	}

	//If there is no error, send the email
	if(!isset($hasError))
	{
		$body = "Name: $name \n\n From: $email \n\nComments: $comments";
		$ret = mail(MAIL_TO, $subject, $body);
		echo 'ret = '.$ret.'<br>';
	}
}
?>
<p class="thanks"><strong>非常感谢!</strong><br><br>&nbsp;&nbsp;&nbsp;&nbsp; 您的咨询已经发送,我们将尽快与您取得联系!</p>